//
//  MineViewModel.swift
//  ManBetX
//
//  Created by Cocoa on 2020/4/13.
//  Copyright © 2020 Fullen. All rights reserved.
//

import UIKit

//我的页面ViewModel
class MineViewModel: BaseViewModel {

    enum CaseType {
        case mineWallet //我的钱包
        case mineDeposit //存款记录
        case mineWithdrawal//取款记录
        case mineTransfer//转账记录
        case mineSelfHelp//自助记录
        case mineBet//投注记录
        
        case mineShare//分享好友
        case mineExit//安全退出
    }
    
    // 圆角类型
    enum RectCornerType {
        case rectCorner(UIRectCorner)//切圆角
        case noCorner //不切圆角
    }
    
    var imageString: String = ""
    var titleString: String = ""
    var infoString: String = ""
    var caseType: CaseType = CaseType.mineWallet
    var rectCornerType: RectCornerType = RectCornerType.noCorner
    
    override func create() {
        switch self.entity as? CaseType {
        case .mineWallet:
            self.imageString = "mine_icon_walletCell"
            self.titleString = "我的钱包"
            self.infoString = ""
            self.caseType = .mineWallet
            self.rectCornerType = RectCornerType.rectCorner([.topLeft,.topRight])
            
        case .mineDeposit:
            self.imageString = "mine_icon_depositCell"
            self.titleString = "存款记录"
            self.infoString = ""
            self.caseType = .mineDeposit
            self.rectCornerType = RectCornerType.noCorner
            
        case .mineWithdrawal:
            self.imageString = "mine_icon_withdrawalCell"
            self.titleString = "取款记录"
            self.infoString = ""
            self.caseType = .mineWithdrawal
            self.rectCornerType = RectCornerType.noCorner
            
        case .mineTransfer:
            self.imageString = "mine_icon_transferCell"
            self.titleString = "转账记录"
            self.infoString = ""
            self.caseType = .mineTransfer
            self.rectCornerType = RectCornerType.noCorner
            
        case .mineSelfHelp:
            self.imageString = "mine_icon_selfHelpCell"
            self.titleString = "自助记录"
            self.infoString = ""
            self.caseType = .mineSelfHelp
            self.rectCornerType = RectCornerType.noCorner
            
        case .mineBet:
            self.imageString = "mine_icon_betCell"
            self.titleString = "投注记录"
            self.infoString = ""
            self.caseType = .mineBet
            self.rectCornerType = RectCornerType.rectCorner([.bottomLeft,.bottomRight])
        case .mineShare:
            self.imageString = "mine_icon_shareCell"
            self.titleString = "分享好友"
            self.infoString = ""
            self.caseType = .mineShare
            self.rectCornerType = RectCornerType.rectCorner([.topLeft,.topRight])
            
        case .mineExit:
            self.imageString = "mine_icon_exitCell"
            self.titleString = "安全退出"
            self.infoString = ""
            self.caseType = .mineExit
            self.rectCornerType = RectCornerType.rectCorner([.bottomLeft,.bottomRight])
        default:
            self.imageString = ""
            self.titleString = "填写错误"
            self.infoString = "填写错误"
            self.caseType = .mineWallet
        }
    }
    
    override func cellHeight() -> CGFloat {
        return 40.0
    }
    
}
